home *** CD-ROM | disk | FTP | other *** search
- /* 4567890123456789012345678901234567890123456789012345678901234567 */
- /*
- * File: Splash.c
- * Author: Mark H. Linton
- * Creation Date: 2/4/95
- * Modification Date:
- * Description: A collection of routines which may be used to
- * display and remove a "splash" screen during
- * application start-up.
- */
- #include <Dialogs.h>
- #include <Memory.h>
-
- #include "Splash.h"
- #include "Toolbox.h"
-
- static DialogPtr theSplashScreen = nil;
- static GrafPtr theCurrentPort = nil;
-
- void Splash(short anID) {
- if (theSplashScreen == nil) {
- GetPort(&theCurrentPort);
- theSplashScreen = GetNewDialog(anID, nil, kInFront);
- #if STRICT_WINDOWS
- SetPortWindowPort(theSplashScreen);
- #else
- SetPort(theSplashScreen);
- #endif
- DrawDialog(theSplashScreen);
- }
- }
-
- void UnSplash(Boolean clean) {
- long ignored;
-
- if (theSplashScreen != nil) {
- DisposeDialog(theSplashScreen);
- theSplashScreen = nil;
- SetPort(theCurrentPort);
- }
- if (clean) {
- (void)MaxMem(&ignored); /* Clean up the heap before we leave */
- }
- }